﻿using System.ComponentModel;

namespace WPNextTools.NBase
{
    public class DataSourceItem : IDataSourceItem
    {
        #region Fields
        private bool isShowed;
        private object value;
        private int index;
        private IDataSourceItem next;
        private IDataSourceItem previous;
        private double _x;
        private double _y;
        private int _columnIndex;
        private double _width;
        private double _height;
        #endregion

        #region Constructor

        public DataSourceItem(object value)
        {
            this.value = value;
        }

        #endregion

        #region Properties
        public bool IsShowed
        {
            get
            {
                return this.isShowed;
            }
            set
            {
                this.isShowed = value;
            }
        }

        public object Value
        {
            get
            {
                return this.value;
            }
        }

        public object DisplayValue { get; set; }

        public IDataSourceItem Next
        {
            get
            {
                return this.next;
            }
            set
            {
                this.next = value;
            }
        }

        public IDataSourceItem Previous
        {
            get
            {
                return this.previous;
            }
            set
            {
                this.previous = value;
            }
        }

        public int Index
        {
            get
            {
                return this.index;
            }
            set
            {
                this.index = value;
            }
        }

        public double X
        {
            get { return _x; }
            set { _x = value; }
        }

        public double Y
        {
            get { return _y; }
            set { _y = value; }
        }

        public int ColumnIndex
        {
            get { return _columnIndex; }
            set { _columnIndex = value; }
        }

        public double Width
        {
            get { return _width; }
            set { _width = value; }
        }

        public double Height
        {
            get { return _height; }
            set { _height = value; }
        }
        #endregion

        #region Method

        public bool ChangeValue(object value)
        {
            this.value = value;
            return true;
        }        
        #endregion

    }
}
